//============================================================================
// Name        : Mar05.cpp
// Author      : Anthony Varghese
// Version     :
// Copyright   : If you change this, add your name to the list of names for authors
// Description : Shows how to use static data members and also order of operations
//                when using the insertion operator.
//============================================================================

#include <iostream>
using namespace std;

class A{
	static int V;
public:
	A(){ V=2;}
	int up(){ return ++V; }
};

// The next line is needed - it usually goes into the A.cpp file
int A::V = 0;

int main(){
	A a;
	A b;

	cout << "In what order are the up method invocations performed? " << endl
			<< " and in what order are they printed? " << endl << endl;

	cout << " a has " << a.up() << " and now: " << a.up() << endl;
	cout << " b has " << a.up() << " and now: " << b.up() << endl;


}
